package com.nsl.my_youlai.controller;

import com.nsl.my_youlai.common.model.ElSelectOption;
import com.nsl.my_youlai.common.result.Result;
import com.nsl.my_youlai.service.SysDeptService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/api/v1/dept")
@RequiredArgsConstructor
public class SysDeptController {
    private final SysDeptService deptService;

    @GetMapping("/options")
    public Result<List<ElSelectOption>> listDeptOptions() {
        List<ElSelectOption> list = deptService.listDeptOptions();
        log.info("list = {}",list);
        return Result.success(list);
    }
}
